//
//  VideoProcessing.h
//  VideoExam
//
//  Created by apple on 2020/6/15.
//

#import <Foundation/Foundation.h>

NS_ASSUME_NONNULL_BEGIN

typedef void(^outputBlock)(NSURL *outputURL);


//视频处理
@interface VideoProcessing : NSObject


/// 视频截取
/// @param asset AVAsset 对象
/// @param startTime 开始时间
/// @param endTime 截取原视频的截止时间
/// @param filePath 截取后的视频 输出路径
/// @param completion 完成回调
+ (void)cutVideoWithAVAsset:(AVAsset *)asset startTime:(CGFloat)startTime endTime:(CGFloat)endTime filePath:(NSString *)filePath completion:(outputBlock)completion errorBlock:(void(^)(void))errorBlock;


/**
 视频添加水印
 @param path 视频本地路径
 @param outputPath 水印视频输出路径
 */
+ (void)addWaterPicWithVideoPath:(NSString*)path outputPath:(NSString *)outputPath completion:(outputBlock)completion errorBlock:(void(^)(void))errorBlock;

/**
 设置水印及其对应视频的位置

 @param composition 视频的结构
 @param size 视频的尺寸
 */
+ (void)applyVideoEffectsToComposition:(AVMutableVideoComposition *)composition size:(CGSize)size;
@end

NS_ASSUME_NONNULL_END
